package org.jmc.refmanager.web.wicket.model;

import java.util.List;

import org.apache.wicket.injection.web.InjectorHolder;
import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.jmc.refmanager.domain.model.OrgUnit;
import org.jmc.refmanager.domain.service.OrgUnitManager;

public class ServicesListModel extends LoadableDetachableModel<List<OrgUnit>> {
	private static final long serialVersionUID = 1L;

	@SpringBean(name="orgUnitManager")
	private OrgUnitManager orgUnitManager;

	/**
	 * 
	 */
	public ServicesListModel() {
		super();
		InjectorHolder.getInjector().inject(this);
	}


	@Override
	protected List<OrgUnit> load() {
		// TODO Auto-generated method stub
		return orgUnitManager.findAll();
	}

}
